<template>
  <el-dialog
    title="修改角色"
    :visible.sync="dialogVisible"
    width="30%"
    class="popup"
    :before-close="handleClose">
    <!-- <el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
      <el-form-item label="角色名称" prop="pass">
        <el-input type="password" v-model="ruleForm.pass" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="平台权限" prop="checkPass">
        <el-input type="password" v-model="ruleForm.checkPass" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="APP权限" prop="age">
        <el-input v-model.number="ruleForm.age"></el-input>
      </el-form-item>
      <el-form-item label="部门权限" prop="age">
        <el-input v-model.number="ruleForm.age"></el-input>
      </el-form-item>
      <el-form-item label="角色描述" prop="age">
        <el-input v-model.number="ruleForm.age"></el-input>
      </el-form-item>
    </el-form> -->

    <!-- <el-tree :data="data" :props="defaultProps"></el-tree> -->

    <!-- <el-tree
      class="tree-line"
      icon-class="el-icon-circle-plus-outline"
      :indent="0"
      :data="data"
  ></el-tree> -->

  <el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
   <el-form-item label="角色名称" prop="pass">
        <el-input type="password" v-model="ruleForm.pass" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="权限字符" prop="checkPass">
        <el-input type="password" v-model="ruleForm.checkPass" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="菜单权限" prop="age">
        <el-input v-model.number="ruleForm.age"></el-input>
      </el-form-item>
      <el-form-item label="角色描述">
        <el-input type="textarea" v-model="ruleForm.age"></el-input>
      </el-form-item>
  </el-form>

    <span slot="footer" class="dialog-footer">
      <el-button size="small" @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" size="small"  @click="dialogVisible = false">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
  import Treeselect from '@riophae/vue-treeselect'
  import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  export default {
    components: {
      Treeselect
    },
    data() {
      return {
        dialogVisible: false,
        ruleForm: {
          pass: '',
          checkPass: '',
          age: ''
        },

        value: null,
        // define options
        options: [ {
          id: 'a',
          label: 'a',
          children: [ {
            id: 'aa',
            label: 'aa',
          }, {
            id: 'ab',
            label: 'ab',
          } ],
        }, {
          id: 'b',
          label: 'b',
        }, {
          id: 'c',
          label: 'c',
        } ],
      }
    },
    computed: {
      rules() {
        return {
          pass: [
            { required: true, message: '请输入活动名称', trigger: 'blur' },
          ],
          checkPass: [
            { required: true, message: '请输入活动名称', trigger: 'blur' },
          ],
          age: [
            { required: true, message: '请输入活动名称', trigger: 'blur' },
          ]
        }
      }
        
    },
    methods: {
      togglePopup(flag) {
        this.dialogVisible = flag
      },
      handleClose(done) {
        this.$confirm('确认关闭？')
          .then(_ => {
            done();
          })
          .catch(_ => {});
      }
    }
  };
</script>

<style lang="scss" scoped>
  .popup {
    ::v-deep .el-dialog {
      border-radius: 4px;
    }
    ::v-deep .el-dialog__header {
      border-bottom: 1px solid #cdd0db;
    }
    ::v-deep .el-dialog__body {
      padding: 30px;
    }
  }
</style>

